package qdu.edu.com.fushanf4.utils;

import java.io.FileInputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Properties;

public class ReadProperties {
    private static final Properties properties = new Properties();
    private static String hostName;

    private static String getValue(String key) {
        try {
            properties.load(new FileInputStream("src/main/resources/LoginInHDFS.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties.getProperty(key);
    }

    public static String getLINK_HDFS_VALUE() {
        try {
            hostName = InetAddress.getLocalHost().getHostName();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        return getValue(hostName);
    }
}
